package org.lanqiao.tjut.action;

import org.lanqiao.tjut.bean.UsersEntity;

import com.opensymphony.xwork2.ActionSupport;

public class UserLoginAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/*
	 * 定义aciton对象变量，为该对象提供getter/setter方法，
	 * 并保证前台jsp页面form表单控件name属性的值和该pojo实体类的属性名 保持一致，则可以自动进行类型转换
	 */
	private UsersEntity userE;

	public String doLogin() {

		// 进行用户登录信息验证
		if (userE != null && userE.getUsername() != null && userE.getUsername().equals("admin")) {
			// 登录成功
			System.out.println("登录用户：" + userE.getUsername());
			// 返回结果串
			return this.SUCCESS;
		}
		// 验证失败
		return "failed";
	}

	public UsersEntity getUserE() {
		return userE;
	}

	public void setUserE(UsersEntity userE) {
		this.userE = userE;
	}

}
